package com.codefactory.aps.classes;

import javax.swing.JOptionPane;

public class ExitManager {
    
    public static void showExitPrompt(){
        
        int reply = JOptionPane.showConfirmDialog(null, "Do you really wish to exit 'APS'?", "Exit?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        
        if(reply == JOptionPane.YES_OPTION){
            systemExit();
        }
        
    }
    
    public static void systemExit(){
        
        LogManager.log("Exited APS.");
        LogManager.closePrintWriter();
        
        System.exit(0);
        
    }
    
}